<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
  "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
	xmlns:h="http://java.sun.com/jsf/html"
	xmlns:f="http://java.sun.com/jsf/core"
	xmlns:p="http://primefaces.org/ui"
	xmlns:ui="http://java.sun.com/jsf/facelets">
<h:head>
	<link href="./css/screen.css" rel="stylesheet" type="text/css" />
</h:head>
<f:event listener="#{systemNavigatePage.userSupportRole}"
	type="preRenderView"></f:event>
<body>
	<ui:include src="./header.xhtml" />
	<div id="content-outer">
		<div id="content">

			<!--  start page-heading -->
			<div id="page-heading">
				<h1>User Management</h1>
			</div>
			<!-- end page-heading -->
			<table border="0" width="100%" cellpadding="0" cellspacing="0"
				id="content-table">
				<tr>
					<th rowspan="3" class="sized"><img
						src="images/shared/side_shadowleft.jpg" width="20" height="300"
						alt="" /></th>
					<th class="topleft"></th>
					<td id="tbl-border-top">&nbsp;</td>
					<th class="topright"></th>
					<th rowspan="3" class="sized"><img
						src="images/shared/side_shadowright.jpg" width="20" height="300"
						alt="" /></th>
				</tr>
				<tr>
					<td id="tbl-border-left"></td>
					<td><!--  start top-search -->
								<div id="top-search">
									<h:form>
										<table border="0" cellpadding="0" cellspacing="0">
											<tr>
												<td><h:inputText
														value="#{systemUserManagementManageBean.searchValue}"
														styleClass="top-search-inp" /></td>
												<td><h:selectOneMenu
														value="#{systemUserManagementManageBean.selectSearchType}"
														styleClass="styledselect">
														<f:selectItem itemValue="idCardNumber"
															itemLabel="ID Card Number"></f:selectItem>
														<f:selectItem itemValue="firstName" itemLabel="First Name"></f:selectItem>
														<f:selectItem itemValue="state" itemLabel="State"></f:selectItem>
														<f:selectItem itemValue="phoneNumber"
															itemLabel="Phone Number"></f:selectItem>
														<f:selectItem itemValue="address" itemLabel="Address"></f:selectItem>
													</h:selectOneMenu></td>
												<td><h:commandButton value="Search"
														action="#{systemUserManagementManageBean.search}"
														image="images/shared/top_search_btn.gif"
														styleClass="search-btn" /></td>
											</tr>
										</table>
									</h:form>
								</div>
								<!--  end top-search -->
							</td>
						<td id="tbl-border-right"></td>
							
				</tr>
				<h:messages infoStyle="color: blue;" errorStyle="color: orange;" />
				<tr>
					<td id="tbl-border-left"></td>
					<td>
						<!--  start content-table-inner ...................................................................... START -->
						<div id="content-table-inner">

							<!--  start table-content  -->
							<div id="table-content">

								<!--  start message-green -->
								

								<!-- Start table -->
								<h:form id="mainform">
									<p:dataTable width="100%"
										styleClass="employeeTable" headerClass="employeeTableHeader"
										rowClasses="employeeTableEvenRow, employeeTableOddRow"
										var="list" paginator="true" rows="10" widgetVar="accTable"
										paginatorTemplate="{CurrentPageReport}  {FirstPageLink} {PreviousPageLink} {PageLinks} {NextPageLink} {LastPageLink} {RowsPerPageDropdown}"  
										rowsPerPageTemplate="5,10,15"
										value="#{systemUserManagementManageBean.systemUserListDataModel}">

										<p:column sortBy="#{list.systemUserID}" filterBy="#{list.systemUserID}">
											<f:facet name="header">SystemUser ID</f:facet>
											<h:outputText value="&nbsp;#{list.systemUserID}"></h:outputText>
										</p:column>
										<p:column sortBy="#{list.userName}" filterBy="#{list.userName}">
											<f:facet name="header">User Name</f:facet>
											<h:outputText value="&nbsp;#{list.userName}"></h:outputText>
										</p:column>
										<p:column>
											<f:facet name="header">ID Card Number</f:facet>
											<h:outputText value="&nbsp;#{list.idCardNumber}"></h:outputText>
										</p:column>
										<p:column sortBy="#{list.firstName}">
											<f:facet name="header">Full Name</f:facet>
											<h:outputText
												value="&nbsp;#{list.lastName}&nbsp;#{list.midName}&nbsp;#{list.firstName}"></h:outputText>
										</p:column>
										<p:column width="80px">
											<f:facet name="header">Phone Number</f:facet>
											<h:outputText value="&nbsp;#{list.phoneNumber}"></h:outputText>
										</p:column>
										<p:column>
											<f:facet name="header">Address</f:facet>
											<h:outputText value="&nbsp;#{list.address}"></h:outputText>
										</p:column>
										<p:column sortBy="#{list.lastUpdate}">
											<f:facet name="header">Last Update</f:facet>
											<h:outputText value="&nbsp;#{list.lastUpdate}"></h:outputText>
										</p:column>
										<p:column sortBy="#{list.systemUserState}">
											<f:facet name="header">State</f:facet>
											<h:outputText value="&nbsp;#{list.systemUserState}"></h:outputText>
										</p:column>
										<p:column width="15px">
											<f:facet name="header">Edit User</f:facet>
											<h:commandLink title="Edit User"
												action="#{systemUserManagementManageBean.edit(list.systemUserID)}"
												styleClass="icon-1 info-tooltip"></h:commandLink>
										</p:column>
										
											<p:column width="15px">
												<f:facet name="header">Edit Role</f:facet>
												<h:commandLink title="Edit Role"
													action="#{systemUserManagementManageBean.editRole(list.systemUserID)}"
													styleClass="icon-1 info-tooltip"></h:commandLink>
											</p:column>
											

									</p:dataTable>
									<!--  <h:dataTable border="1" width="100%" cellpadding="10"
										styleClass="employeeTable" headerClass="employeeTableHeader"
										rowClasses="employeeTableEvenRow, employeeTableOddRow"
										var="list"
										value="#{systemUserManagementManageBean.systemUserListDataModel}">

										<h:column>
											<f:facet name="header">System User ID</f:facet>
											<h:outputText value="&nbsp;#{list.systemUserID}"></h:outputText>
										</h:column>
										<h:column>
											<f:facet name="header">User Name</f:facet>
											<h:outputText value="&nbsp;#{list.userName}"></h:outputText>
										</h:column>
										<h:column>
											<f:facet name="header">ID Card Number</f:facet>
											<h:outputText value="&nbsp;#{list.idCardNumber}"></h:outputText>
										</h:column>
										<h:column>
											<f:facet name="header">Full Name</f:facet>
											<h:outputText
												value="&nbsp;#{list.lastName}&nbsp;#{list.midName}&nbsp;#{list.firstName}"></h:outputText>
										</h:column>
										<h:column>
											<f:facet name="header">Phone Number</f:facet>
											<h:outputText value="&nbsp;#{list.phoneNumber}"></h:outputText>
										</h:column>
										<h:column>
											<f:facet name="header">Address</f:facet>
											<h:outputText value="&nbsp;#{list.address}"></h:outputText>
										</h:column>
										<h:column>
											<f:facet name="header">Last Update</f:facet>
											<h:outputText value="&nbsp;#{list.lastUpdate}"></h:outputText>
										</h:column>
										<h:column>
											<f:facet name="header">State</f:facet>
											<h:outputText value="&nbsp;#{list.systemUserState}"></h:outputText>
										</h:column>
										<h:column>
											<f:facet name="header">Edit User</f:facet>
											<h:commandLink title="Edit User"
												action="#{systemUserManagementManageBean.edit(list.systemUserID)}"
												styleClass="icon-1 info-tooltip"></h:commandLink>
										</h:column>
										<h:column>
											<f:facet name="header">Edit Role</f:facet>
											<h:commandLink title="Edit Role"
												action="#{systemUserManagementManageBean.editRole(list.systemUserID)}"
												styleClass="icon-1 info-tooltip"></h:commandLink>
										</h:column>


									</h:dataTable>-->
									<!--  start list-table ..................................................................................... -->
									<!-- <table style="margin-top: 30px" border="0" width="100%"
										cellpadding="0" cellspacing="0" id="product-table">

										<tr>
											<th class="table-header-repeat line-left">&nbsp;System
												User ID</th>
											<th class="table-header-repeat line-left">&nbsp;User
												Name</th>
											<th class="table-header-repeat line-left">&nbsp;ID Card
												Number</th>
											<th class="table-header-repeat line-left">&nbsp;Full
												Name</th>
											<th class="table-header-repeat line-left">&nbsp;Phone
												Number</th>
											<th class="table-header-repeat line-left">&nbsp;Address</th>
											<th class="table-header-repeat line-left">&nbsp;Last
												Update</th>
											<th class="table-header-repeat line-left">&nbsp;State</th>
											<th class="table-header-repeat line-left" width="30px">
												&nbsp;&nbsp;Edit &nbsp;&nbsp;User</th>
											<h:panelGroup rendered="#{systemNavigatePage.checkIsAdmin()}">
												<th class="table-header-repeat line-left" width="30px">
													&nbsp;&nbsp;Edit &nbsp;&nbsp;Role</th>
											</h:panelGroup>

										</tr>
										<tbody>
											<ui:repeat var="list"
												value="#{systemUserManagementManageBean.systemUserListDataModel}"
												varStatus="status">
												<tr>
													<td style="text-align: left"><h:outputText
															value="#{list.systemUserID}"></h:outputText></td>
													<td style="text-align: cente"><h:outputText
															value="#{list.userName}"></h:outputText></td>
													<td style="text-align: left"><h:outputText
															value="#{list.idCardNumber}"></h:outputText></td>
													<td style="text-align: left"><h:outputText
															value="#{list.lastName}&nbsp;#{list.midName}&nbsp;#{list.firstName}"></h:outputText>
													</td>
													<td style="text-align: left"><h:outputText
															value="#{list.phoneNumber}"></h:outputText></td>
													<td style="text-align: left"><h:outputText
															value="#{list.address}"></h:outputText></td>
													<td style="text-align: left"><h:outputText
															value="#{list.lastUpdate}"></h:outputText></td>
													<td style="text-align: left"><h:outputText
															value="#{list.systemUserState}"></h:outputText></td>
													<td style="align: center"><h:commandLink
															title="Edit User"
															action="#{systemUserManagementManageBean.edit(list.systemUserID)}"
															styleClass="icon-1 info-tooltip"></h:commandLink></td>
													<h:panelGroup rendered="#{systemNavigatePage.checkIsAdmin()}">
														<td style="align: center"><h:commandLink
																
																title="Edit Role"
																action="#{systemUserManagementManageBean.editRole(list.systemUserID)}"
																styleClass="icon-1 info-tooltip"></h:commandLink>
														</td>
													</h:panelGroup>

												</tr>
											</ui:repeat>
										</tbody>
									</table>-->
									<!--  end table................................... -->
								</h:form>
							</div>
							<!--  end content-table  -->

							<div class="clear"></div>

						</div> <!--  end content-table-inner ............................................END  -->
					</td>
					<td id="tbl-border-right"></td>
				</tr>
				<tr>
					<th rowspan="3" class="sized"></th>
					<th class="sized bottomleft"></th>
					<td id="tbl-border-bottom">&nbsp;</td>
					<th class="sized bottomright"></th>
					<th rowspan="3" class="sized"></th>
				</tr>
			</table>
		</div>
	</div>
</body>
</html>
